package com.monsterPatties.screens 
{
	import com.monsterPatties.interfaces.IDestroyable;
	import com.monsterPatties.utils.displayManager.config.DisplayManagerConfig;
	import com.monsterPatties.utils.displayManager.DisplayManager;
	import com.monsterPatties.utils.displayManager.Window;
	import flash.events.Event;
	import flash.events.MouseEvent;
	/**
	 * ...
	 * @author jc
	 */
	public class OptionScreen extends Window implements IDestroyable
	{
		/*-----------------------------------------------------------Constant--------------------------------------------------------*/
		
		/*-----------------------------------------------------------Properties--------------------------------------------------------*/
		
		/*-----------------------------------------------------------Constructor--------------------------------------------------------*/
		
		
		public function OptionScreen( windowName:String ) 
		{
			super( windowName );
			addEventListener( Event.ADDED_TO_STAGE, init );
		}
		
		private function init(e:Event):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			setDisplay();
		}
		
		/*-----------------------------------------------------------Methods--------------------------------------------------------*/
		private function setDisplay ():void 
		{
			addWindowBg( new WindowGraphic() );			
			this.addEventListener( MouseEvent.CLICK, onShowPopUp );
		}
		
		private function onShowPopUp(e:MouseEvent):void 
		{
			var dm:DisplayManager = DisplayManager.getInstance();
			dm.addPopWindow( new PopUpWindow( DisplayManagerConfig.POP_UP_WINDOW_MESSAGE ) );
			dm.loadPopUpWindow( DisplayManagerConfig.POP_UP_WINDOW_MESSAGE );			
			trace( "show popup" );
		}
		
		private function removeDisplay ():void 
		{
			removeWindowBg();
		}
		
		
		public function destroy():void 
		{
			removeDisplay();
		}
		
		/*-----------------------------------------------------------Setters--------------------------------------------------------*/
		/*-----------------------------------------------------------Getters--------------------------------------------------------*/
		/*-----------------------------------------------------------EventHandlers--------------------------------------------------------*/
	}

}